TARGET = parsejsonfile

SRCS = $(wildcard *.c)

OBJS = $(SRCS:.c=.o)

CC = gcc

#DEFS += -DDEBUG_FILE

INC = `pkg-config --cflags json-c`

CFLAGS += -Wall -fno-strict-aliasing -W -std=gnu99
CFLAGS += ${DEFS} $(INC)

OFLAGS += -Os
LDFLAGS += $(OFLAGS) -Wl,-Bstatic -Wl,-Bdynamic `pkg-config --libs json-c`

all:$(TARGET)

$(TARGET):$(OBJS)
	$(CC) -o $@ $^ ${LDFLAGS}

%.o:%.c
	$(CC) $(CFLAGS) -o $@ -c $<

clean:
	rm -rf $(TARGET) $(OBJS)
